
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>多个AOP的顺序怎么定？ - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>多个AOP的顺序怎么定？ - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在 Spring AOP 中，如何使用 `@Order` 注解来控制切面（Aspect）的执行顺序？它的优先级规则是怎样的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">使用 `@Order` 注解可以为切面指定一个优先级。其规则是：值越低，优先级越高；值越高，优先级越低。</div>
          </div>
          <div class="card-source">来源: 1. @Order 注解</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">假设有两个切面，AspectA 使用 `@Order(1)`，AspectB 使用 `@Order(2)`，哪个切面的前置通知（Before Advice）会先执行？为什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">AspectA 的前置通知会先执行。因为 `@Order(1)` 的值低于 `@Order(2)`，所以 AspectA 的优先级更高。</div>
          </div>
          <div class="card-source">来源: 1. @Order 注解</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">当同一个切面类中有多个通知（Advice）匹配同一个切点时，它们的执行顺序是如何决定的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在同一个切面类中，多个通知对同一个切点的处理顺序是由它们在切面类中定义的顺序决定的。先定义的通知会先执行。</div>
          </div>
          <div class="card-source">来源: 2. 切点的匹配顺序</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">除了使用注解，还有什么方式可以显式地控制多个切面的应用顺序？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">可以在 Spring 的配置文件（如XML配置）或 Java 配置类中显式地指定切面的应用顺序，切面会按照配置的顺序执行。</div>
          </div>
          <div class="card-source">来源: 3. 切面应用顺序</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在 Spring AOP 中，继承关系如何影响切面的执行顺序？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">如果使用了继承，子类中的切面会覆盖父类中的切面。此外，Spring AOP 创建代理的顺序也会影响最终的执行顺序。</div>
          </div>
          <div class="card-source">来源: 4. 继承和代理</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">请总结文档中提到的控制 Spring AOP 中多个切面执行顺序的几种主要机制。</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">文档中提到的主要机制包括：1. 使用 `@Order` 注解定义优先级；2. 同一切面中通知的定义顺序；3. 在 Spring 配置中显式指定顺序；4. 利用继承关系和代理创建顺序；5. 通过编程逻辑显式调用。</div>
          </div>
          <div class="card-source">来源: 全文概述 (章节 1-5)</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
